unit uedit;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls, cxLookAndFeels,
  cxLookAndFeelPainters, cxContainer, cxEdit, dxSkinsCore, dxSkinBlack,
  dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
  dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
  dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
  dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
  dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
  dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
  dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
  dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
  dxSkinOffice2013White, dxSkinOffice2016Colorful, dxSkinOffice2016Dark,
  dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
  dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
  dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinsDefaultPainters,
  dxSkinValentine, dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark,
  dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint,
  dxSkinXmas2008Blue, Vcl.StdCtrls, System.Actions, Vcl.ActnList, cxMemo,
  cxDBEdit, cxTextEdit;

type
  Tfedit = class(TForm)
    cxdbtxtdt1: TcxDBTextEdit;
    cxdbtxtdt3: TcxDBTextEdit;
    cxdbtxtdt4: TcxDBTextEdit;
    cxdbtxtdt5: TcxDBTextEdit;
    cxdbm1: TcxDBMemo;
    btnsave: TButton;
    btncancel: TButton;
    actlst1: TActionList;
    act_save: TAction;
    act_cancel: TAction;
    lbl1: TLabel;
    lbl2: TLabel;
    lbl3: TLabel;
    lbl4: TLabel;
    lbl5: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormDestroy(Sender: TObject);
    procedure act_saveExecute(Sender: TObject);
    procedure act_cancelExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fedit: Tfedit;

implementation
       uses
       udm,umain;
{$R *.dfm}

procedure Tfedit.act_cancelExecute(Sender: TObject);
begin
DataModule2.fdqry1.Cancel;
Close;
end;

procedure Tfedit.act_saveExecute(Sender: TObject);
begin
DataModule2.fdqry1.Post;
end;

procedure Tfedit.FormClose(Sender: TObject; var Action: TCloseAction);
begin
        action:=caFree;
end;

procedure Tfedit.FormCreate(Sender: TObject);
begin
       if  DataModule2.fdqry1.Active=False then
    begin
        DataModule2.fdqry1.Active:=True;
    end;
    DataModule2.fdqry1.Edit;
end;

procedure Tfedit.FormDestroy(Sender: TObject);
begin
     fedit:=nil;
end;

end.
